package com.mkksoft.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.mkksoft.service.HelloService;
import com.mkksoft.vo.ServerAccount;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Reference
    private HelloService helloService;

//    @RequestMapping(value = "/hello")
 //   @GetMapping(value = "/hello")
    @PostMapping(value = "/hello")
    public String hello() {
        String hello = helloService.sayHello("world");
        System.out.println(helloService.sayHello("BJQ"));
        return hello;
    }

    @GetMapping(value = "/getSerAcctById")
    public ServerAccount getSerAcctById(@RequestParam("id") Integer id){
        return helloService.getServerAccountById(id);
    }

}
